<?php
namespace XmlTool\Listener;

use App\Models\Review\ActivityFormModel;
use App\Models\Review\ActivityModel;
use Illuminate\Support\Facades\Log;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Symfony\Component\Console\Output\ConsoleOutput;

class ActivityFormSubmitListener implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
    private $model;
    public function __construct($model)
    {
        $this->model=$model;
        $this->onQueue('review_activity_form');
    }
    public function handle(){
        $console=new ConsoleOutput();
        $obj=ActivityFormModel::create($this->model);
        $console->write(__CLASS__.":{$obj->uni_id}({$obj->id})",true);
    }
}